/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

const _import = require('./_import');
import Layout from '@/page/index/';
import Customerview from '../views/customer/Customerview';
import marketingReport from '../views/marketingManagement/marketingReport';
import marketingManagementAdd from '../views/marketingManagement/marketingManagementAdd';
import marketingManagementEdit from '../views/marketingManagement/marketingManagementEdit';
import WXTemplateAdd from '../views/marketingManagement/WXTemplateAdd';
import WXTemplateEdit from '../views/marketingManagement/WXTemplateEdit';
import AddCustomer from '../views/customer/AddCustomer';
import CustomerList from '../views/customer/CustomerList';
import AddCustomerGroup from '../views/customer/AddCustomerGroup';
import LeadCustomer from '../views/customer/CustomerLead';
import Gradesetting from '../views/Loyaltymanagement/Gradesetting';
import Addgrade from '../views/Loyaltymanagement/Addgrade';
import EditIntegral from '../views/Loyaltymanagement/EditIntegral';

export default [
  {
    path: '/',
    name: '主页',
    redirect: '/wel'
  },
  {
    path: '/wel',
    component: Layout,
    redirect: '/wel/index',
    children: [{
      path: 'index',
      name: '首页',
      component: _import('wel')
    }]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  },
  {
    path: '/login',
    name: '登录页',
    component: _import('login/index')
  },
  {
    path: '/lock',
    name: '锁屏页',
    component: _import('lock/index')
  },
  {
    path: '/crud',
    component: Layout,
    redirect: '/crud/index',
    children: [{
      path: 'index',
      name: 'crud实例',
      component: _import('crud/index', 'views')
    }]
  },
  {
    // 页面间路由跳转在这里配置
    path: '/info',
    component: Layout,
    redirect: '/info/index',
    children: [
      {
        path: 'index',
        name: '修改信息',
        component: _import('admin/user/info', 'views')
      },
      {
        path: '/static/customerview/id=:id/buttonid=:buttonid',
        component: Customerview,
        name: '客户360°视图'
      },
      {
        path: '/static/marketingreport/:id',
        component: marketingReport,
        name: '营销效果报告'
      },
      {
        path: '/static/marketingManagementAdd',
        component: marketingManagementAdd,
        name: '新增营销活动'
      },
      {
        path: '/static/marketingManagementEdit/:id',
        component: marketingManagementEdit,
        name: '编辑营销活动'
      },
      {
        path: '/campaign/wxtemplate/add',
        component: WXTemplateAdd,
        name: '添加微信模板'
      },
      {
        path: '/campaign/wxtemplate/edit',
        component: WXTemplateEdit,
        name: '添加微信编辑模板'
      },
      {
        path: '/static/AddCustomer',
        component: AddCustomer,
        name: '新建客户'
      },
      {
        path: '/customer/editCustomer/:id',
        component: AddCustomer,
        name: '编辑客户'
      },
      {
        path: '/customer/addCustomerGroup/:id',
        component: AddCustomerGroup,
        name: '客户筛选'
      },
      {
        path: '/customer/customerLead',
        component: LeadCustomer,
        name: '客户导入'
      },
      {
        path: '/customer/CustomerList/',
        component: CustomerList,
        name: '客户列表',
        meta: {
          keepAlive: true, //该字段表示该页面需要缓存
        },
      },
      {
        path: '/customer/targetCustomerList/:targetId',
        component: CustomerList,
        name: '客户分组-查看客户',
      },
      {
        path: '/loyalty/gradesetting',
        component: Gradesetting,
        name: '等级设置',
      },
      {
        path: '/loyalty/addgrade',
        component: Addgrade,
        name: '新增等级',
      },
      {
        path: '/loyalty/editorGrade/:id',
        component: Addgrade,
        name: '修改等级',
      },
      {
        path: '/loyalty/editIntegral/:interacttype',
        component: EditIntegral,
        name: '编辑积分规则',
      },
    ]
  },
  {
    path: '/404',
    component: _import('error-page/404', 'components'),
    name: '404'
  },
  {
    path: '/403',
    component: _import('error-page/403', 'components'),
    name: '403'
  },
  {
    path: '/500',
    component: _import('error-page/500', 'components'),
    name: '500'
  },
  {
    path: '/myiframe',
    component: Layout,
    redirect: '/myiframe',
    meta: {
      keepAlive: true
    },
    children: [{
      path: ':routerPath',
      name: 'iframe',
      component: _import('iframe/main', 'components'),
      props: true
    }]
  },
]
